<?php
//session_start();
include("connection/connection.php");
if(isset($_POST['add']))
{
	$district_id=$_POST['district2'];
	$population_factor=$_POST['population_factor'];
	$qry="select distinct district_name,district_id from tbl_lookup_location where district_id='$district_id'";
	$rec=mysql_query($qry);
	$row=mysql_fetch_array($rec);
	$districtid=$row['district_id'];
	$district_name=$row['district_name'];
	
	
	$qry1="select district_id from tbl_lookup_pop_factor where district_id='$district_id'";
	$result=mysql_query($qry1);
	$row1=mysql_fetch_array($result);
	$dist_id=$row1['district_id'];
	
	
	if($district_id != $dist_id )
	{
	$query3="insert into tbl_lookup_pop_factor(district_id,district_name,population_factor) values('$district_id','$district_name','$population_factor')";
	$result3=mysql_query($query3);
	}else{
	   $msg="information already exist";
	     }
	
	
}
?>
